<template>
    <view class="page-branch-add">
        <view class="p-4" v-if="list.length == 0">
            <u-empty text="暂无数据" mode="list"></u-empty>
        </view> 
        <view class="mx-4">
            <view class="info" v-for="(item,index) in list" :key="index">
                <fly-info label="申请时间" :value="item.createTime"></fly-info>
                <fly-info label="分会名称" :value="item.guildsName"></fly-info>
                <fly-info label="所属公会" :value="item.whereGuildsName"></fly-info>
                <!-- <fly-info label="状态" :value="proxy.$util.setName(item.status, optionData.guidsApplyStatus)"></fly-info> -->
                <fly-info label="状态">
                    <text :class="'status-' + item.status">{{ proxy.$util.setName(item.status, optionData.guidsApplyStatus) }}</text>
                </fly-info>
                <!-- <fly-info label="" :value="info.createTime"></fly-info> -->
            </view>
            <!-- <view class="content">说明</view> -->
            <!-- <u-button class="btn-deepCyan" @click="proxy.$util.gotoPage('/packageA/branch/apply')" v-if="canApply">去申请</u-button> -->
        </view>
    </view>
</template>
<script setup lang="ts">
import FlyInfo from '@/components/FlyInfo/index';
import { onShow } from '@dcloudio/uni-app';
import { useOptionData } from '@/stores/optionData';
let optionDataStore = useOptionData();
const {proxy} = getCurrentInstance() as ComponentInternalInstance;
let list = ref();
let canApply = ref(false);
let optionData = reactive({});
const getInitData = async () => {
  optionData.guidsApplyStatus = await optionDataStore.getDictList('guidsApply_status');
}
const getApplyInfo = () => {
    proxy.$http('get', '/admin/guidsApply/myApply', {}, (data,msg) => {
        list.value = data;
        if(data.length == 0){
            canApply.value = true;
        }else{
            let b = data.some(item => item.status == '0' || item.status == '2');
            canApply.value = !b;
        }
        
    });
}
onShow(() => {
    getInitData();
    getApplyInfo();
})
</script>
<style>
/* page{height:100%;background:#fff;} */
</style>